Query

A query to retrieve information from the syntax tree.

struct Query {}

Constructors

this
this(Language language, string queryString)

Create a new query from a string containing one or more S-expression patterns.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

capture_count
int capture_count()

Get the number of captures in the query.

capture_name
string capture_name(TSQueryCapture capture)

Get the name of one of the query's captures, given a TSQueryCapture.

capture_name_for_id
string capture_name_for_id(uint captureId)

Get the name of one of the query's captures.

disable_capture
void disable_capture(string captureName)

Disable a certain capture within a query.

disable_pattern
void disable_pattern(uint patternId)

Disable a certain pattern within a query.

exec
QueryIterator exec(Node node)

Execute a query over an entire node.

exec
QueryIterator exec(Node node, uint min, uint max)

Execute a query between given start and end byte offsets.

exec
QueryIterator exec(Node node, Point min, Point max)

Execute a query between given start and end Points.

pattern_count
int pattern_count()

Get the number of patterns in the query.

predicates_for_pattern
const(TSQueryPredicateStep)[] predicates_for_pattern(uint patternId)

Get all of the predicates for the given pattern in the query.

query_string_value_for_id
string query_string_value_for_id(uint id)

Get the name of one of the query's string literals.

start_byte_for_pattern
int start_byte_for_pattern(uint patternId)

Get the byte offset where the given pattern starts in the query's source.

step_is_definite
bool step_is_definite(uint byteOffset)

Check if a given step in a query is 'definite'.

string_count
int string_count()

Get the number of string literals in the query.

Variables

tsquery
TSQuery* tsquery;

The underlying TSQuery

Meta